﻿using UnityEngine;
using System.Collections;

public class PlayerAnim : MonoBehaviour
{

    public float qSpeed;
    private float a;
    
    //动画
    void Update ()
    {
        this.transform.Rotate (0, 0, qSpeed * Time.deltaTime);
        a += qSpeed * Time.deltaTime;
        if (a > 30)
        {
            a = 0;
            qSpeed *= -1;
        }
        if (a < -30)
        {
            a = 0;
            qSpeed *= -1;
        }
    }
}
